<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>幸运抽奖页面（居中按钮·浅粉版）</title>
    <style>
        body {
            font-family: "Microsoft YaHei", sans-serif;
            max-width: 500px;
            margin: 0 auto;
            padding: 20px;
            background-color: #fff5f5;
        }
        .lottery-box {
            background: linear-gradient(45deg, #ff9a9e, #fad0c4);
            border-radius: 12px;
            padding: 30px;
            box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
            display: flex;
            flex-direction: column;
            align-items: center;
        }
        h1 {
            color: white;
            margin-bottom: 25px;
            text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
            text-align: center;
        }
        .result-area {
            background-color: white;
            border-radius: 10px;
            padding: 50px 20px;
            margin-bottom: 25px;
            min-height: 80px;
            width: 100%;
            box-sizing: border-box;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 24px;
            font-weight: bold;
            color: #333;
            box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
        }
        .text-pulse {
            animation: pulse 0.3s linear infinite;
        }
        @keyframes pulse {
            0%, 100% { transform: scale(1); }
            50% { transform: scale(1.05); }
        }
        .text-flash {
            animation: flash 0.5s ease-in-out infinite;
        }
        @keyframes flash {
            0%, 100% { opacity: 1; }
            50% { opacity: 0.7; }
        }
        button {
            background-color: #ff6b8b;
            color: white;
            border: none;
            padding: 14px 40px;
            font-size: 18px;
            font-weight: bold;
            border-radius: 30px;
            cursor: pointer;
            transition: all 0.3s;
            box-shadow: 0 5px 10px rgba(255, 107, 139, 0.3);
            margin: 10px 0;
        }
        button:hover {
            background-color: #ff4d79;
            transform: translateY(-3px);
            box-shadow: 0 8px 15px rgba(255, 107, 139, 0.4);
        }
        button:active {
            transform: translateY(1px);
        }
        .tips {
            margin-top: 15px;
            color: #666;
            font-size: 14px;
            text-align: center;
        }
    </style>
</head>
<body>
    <div class="lottery-box">
        <h1>幸运大抽奖</h1>
        
        <div class="result-area" id="lotteryResult">
            <span id="resultText">点击按钮开始抽奖</span>
        </div>
        
        <button id="drawBtn">开始抽奖</button>
        
        <div class="tips">
            每次抽奖将随机获得一份奖品
        </div>
    </div>

    <script>
        const drawBtn = document.getElementById('drawBtn');
        const resultText = document.getElementById('resultText');
        
        const prizes = [
            "🎉 一等奖：智能手机",
            "🎁 二等奖：平板电脑",
            "🎧 三等奖：无线耳机",
            "🔋 四等奖：充电宝",
            "📱 五等奖：数据线",
            "😔 幸运奖：谢谢参与"
        ];
        
        let isDrawing = false;
        
        drawBtn.addEventListener('click', function() {
            if (isDrawing) return;
            
            isDrawing = true;
            drawBtn.disabled = true;
            drawBtn.textContent = "抽奖中...";
            resultText.textContent = "抽奖中...";
            
            resultText.classList.add('text-pulse', 'text-flash');
            
            let frame = 0;
            const maxFrame = 30;
            const drawTimer = setInterval(function() {
                frame++;
                const randomPrize = prizes[Math.floor(Math.random() * prizes.length)];
                resultText.textContent = randomPrize;
                
                if (frame >= maxFrame) {
                    clearInterval(drawTimer);
                    getFinalPrize();
                }
            }, 40);
        });
        
        function getFinalPrize() {
            const randomIndex = Math.floor(Math.random() * prizes.length);
            const finalPrize = prizes[randomIndex];
            
            resultText.classList.remove('text-pulse', 'text-flash');
            
            if (finalPrize.includes("一等奖")) {
                resultText.style.color = "#ff4d79";
            } else if (finalPrize.includes("二等奖")) {
                resultText.style.color = "#ff7043";
            } else if (finalPrize.includes("三等奖")) {
                resultText.style.color = "#ffb74d";
            } else {
                resultText.style.color = "#333";
            }
            
            resultText.textContent = finalPrize;
            
            drawBtn.disabled = false;
            drawBtn.textContent = "再抽一次";
            isDrawing = false;
        }
    </script>
</body>
</html>